#include <iostream>
#include <string>
#include "tool/ClassReflectionTool.hpp"

class A : public ClassReflectionTool::Object<std::string> {
    public:
    A() = default;
    ~A() = default;
    int inumber;

    std::string getType()override {
        return "A";
    }
    void test() {
        std::cout << "A::test()" << std::endl;
    }
};
REGISTER_CLASS(A);
REGISTER_CLASS_FIELD(A,inumber,int);
REGISTER_CLASS_METHOD(A,test,void);


int main() {

    typename ClassReflectionTool::ClassFactory<std::string>* factory =ClassReflectionTool::ClassFactory<std::string>::getSingleton();

        typename ClassReflectionTool::Object<std::string>* obj = factory->createClass("A");

        std::string fieldName = "inumber";obj->set(fieldName,2);A* a = (A*)obj;std::cout << a->inumber << std::endl;std::string funcName = "test";obj->call<void>(funcName);





    return 0;
}